package com.dyh.quickdemozwei.util;

import org.springframework.util.StringUtils;

public interface ElectValueUtil {
    /*越靠前优先级越高*/
    public static String elect(String... targets){
        for (String out:targets){
            if (!StringUtils.isEmpty(out))
                return out;
        }
        return null;
    }
    public static Object elect(Object... targets){
        for (Object out:targets){
            if (null!=out)
                return out;
        }
        return null;
    }

    public static void main(String[] args) {
       String res = ElectValueUtil.elect("","dawd","c");

        System.out.println(res);
    }

}
